<?php

class GlobalModel {
	public function __construct () {
		$data = explode(':', xine::$config['storage']['connectionString']);
		mysql_connect($data[0], $data[1], $data[2]);
        mysql_select_db($data[3]);
        mysql_set_charset('utf8');
	}
	
	public function getDiscussion ($id) {
		$discussion = array();
		$sql = "SELECT * FROM `xine_discussions` WHERE `id`='$id' LIMIT 1";
		
		return mysql_fetch_assoc(mysql_query($sql));
	}
	
	public function error () {
		return mysql_error();
	}
}